package com.aaa.ssm.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @FileName: ResultUtil
 * @Description:  统一返回结果工具类
 * @Author: ghz
 * @CreateTime:2025/8/22 14:54
 * @Version:1.0.0
 */
@Data

public class ResultUtil {
    public static <A> Result success(A data){
        return new Result(ResultStatus.SUCCESS.getStatusCode(),ResultStatus.SUCCESS.getStatusMessage(), data);
    }
    public static <A> Result fail(A data){
        return new Result(ResultStatus.FAIL.getStatusCode(),ResultStatus.FAIL.getStatusMessage(),data);
    }
}
